#ifndef __EXPORT__
#define __EXPORT__

#include "Kernel.h"

CKernel &GetKernel()
{
	return *reinterpret_cast< CKernel * >( CKernel::Instance() );
}


#ifdef __cplusplus
extern "C"
{
#endif
	__declspec(dllexport) bool __cdecl Initialization();
	__declspec(dllexport) void __cdecl Stop();
	__declspec(dllexport) IKernel & __cdecl Kernel();
#ifdef __cplusplus
}
#endif

__declspec(dllexport) IKernel & __cdecl Kernel()
{
	return *dynamic_cast<IKernel *>( &GetKernel() );
}

__declspec(dllexport) bool __cdecl Initialization()
{
	bool bRetVal = false;
	try
	{
		bRetVal = GetKernel().Init( nullptr, nullptr, 0 );
	}
	catch (...)
	{
		goto __end;
	}
__end:
	return bRetVal;
}

#if (_MSC_VER == 1600)

#endif // (_MSC_VER == 1600)


__declspec(dllexport) void __cdecl Stop()
{
	bool bRetVal = false;
	try
	{
		GetKernel().Stop();
	}
	catch (...)
	{
		goto __end;
	}
__end:
	return;
}

#endif

